PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Tell (Compound Statement)

A compound Tell statement specifies the default target of the commands it contains.

SYNTAX
tell referenceToObject
    [ statement ]...
end [ tell ]

where

referenceToObject is a reference to an application object, system object, or script object.

statement is any AppleScript statement.

EXAMPLES

The next three examples show how to close a window using, respectively, a compound Tell statement, a simple Tell statement, and a very brief version of a simple Tell statement.

tell application "Finder"
    tell front window
        close
    end tell
end tell
tell front window of application "Finder"
    close
end tell
tell app "Finder" to close front window

The following example closes a window on a remote computer.

tell application "Finder" of machine ¬
    "Steve's PowerBook" of zone "Fourth Floor South"
        tell front window
            close
        end tell
end tell
NOTES

If referenceToObject specifies an application on a remote computer, additional conditions must be met. These conditions are described in References to Remote Applications.

If referenceToObject specifies an application on the same computer that is not running, AppleScript launches the application.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)